import request from 'plugin/axios'

export function getAlipayShopList(params:any):Promise<any>{
    return request({
        url:'v1/seller/alipay/list',
        params,
        method:'get'
    })
}

export function setAlipayShop(data:any):Promise<any>{
    return request({
        url:'v1/seller/alipay/set',
        data,
        method:'post'
    })
}

export function getAlipayDetail(params:any):Promise<any>{
    return request({
        url:'v1/seller/alipay/get',
        params,
        method:'get'
    })
}

export function toggleAlipayStatus(data:any):Promise<any>{
    return request({
        url:'v1/seller/alipay/status/toggle',
        data,
        method:'post'
    })
}


export function getBankShopList(params:any):Promise<any>{
    return request({
        url:'v1/seller/union_pay/list',
        params,
        method:'get'
    })
}

export function setBankShop(data:any):Promise<any>{
    return request({
        url:'v1/seller/union_pay/set',
        data,
        method:'post'
    })
}

export function getBankDetail(params:any):Promise<any>{
    return request({
        url:'v1/seller/union_pay/get',
        params,
        method:'get'
    })
}

export function toggleBankStatus(data:any):Promise<any>{
    return request({
        url:'v1/seller/alipay/status/toggle',
        data,
        method:'post'
    })
}

export function getServiceArea():Promise<any>{
    return request({
        url:'v1/agent/region/get',
        method:'get'
    })
}


/**
 * 获取花呗店铺列表
 * @param params 请求参数
 */
export function getHuabeiList(params: any): Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/list',
      params,
      method: 'get',
    })
  }
  
  /**
   * 获取花呗店铺详情
   * @param params 请求参数
   */
  export function getHuabeiDetail(params: any): Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/detail/get',
      params,
      method: 'get',
    })
  }
  
  export function setHuabeiAuth(data: any):Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/auth/set',
      data,
      method: 'post',
    })
  }
  
  export function openHuabeiPay(data: any):Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/pay/open',
      data,
      method: 'post',
    })
  }
  
  export function openHuabeiRoyalty(data: any):Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/royalty/open',
      data,
      method: 'post',
    })
  }
  
  export function getHuabeiRoyaltyRelation(data: any):Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/royalty/relation',
      data,
      method: 'post',
    })
  }
  
  export function setHuabeiRoyaltyRate(data: any):Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/royalty/rate/set',
      data,
      method: 'post',
    })
  }
  
  export function setHuabeiPeriod(data: any):Promise<any> {
    return request({
      url: 'v1/seller/hua_bei/period/set',
      data,
      method: 'post',
    })
  }

